//
//  DismissAnimator.m
//  MyFunctionDemo
//
//  Created by Ting Han on 2017/9/1.
//  Copyright © 2017年 Ting Han. All rights reserved.
//

#import "DismissAnimator.h"
#import "UIView+AnimationProperty.h"
#import "UIView+SetRect.h"

@implementation DismissAnimator
- (void)transitionAnimation {
    
    [self.containerView insertSubview:self.toViewController.view belowSubview:self.fromViewController.view];
    
    [UIView animateWithDuration:self.transitionDuration animations:^{
        
        self.toViewController.view.scale = 1.f;
        self.fromViewController.view.y   = [UIScreen mainScreen].bounds.size.height;
        
    } completion:^(BOOL finished) {
        
        [self completeTransition];
    }];
}

@end
